#include <iostream>
//#define int unsigned long long
#define int long long
#define all(x) x.begin(), x.end()
using namespace std;
 
signed main()
{
	int t; cin >> t;
	while (t--)
	{
		int n, m; cin >> n >> m;
		int prev = 0, cur = 0;
		bool jug = true;
		while(m--)
		{
			cin >> cur;
			if (jug && cur <= prev) jug = false;
			prev = cur;
		}
		if (jug == false) cout << 1 << endl;
		else cout << n - prev + 1 << endl;
	}
	return 0;
}
 
//5 4 1 1 5 3 1 2 3 6 6 3 1 2 3 4 1 100000 1 100000 4 2 1 1